home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / mxcode / fmplay11 / adlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-09  |  1.4 KB  |  49 lines

  1. /* The original version of this file was written by Kevin A. Lee */
  2.  
  3. #define MIN_REGISTER        0x01
  4. #define MAX_REGISTER        0xF5
  5. #define ADLIB_FM_ADDRESS    0x388       /* adlib address/status register */
  6. #define ADLIB_FM_DATA       0x389       /* adlib data register           */
  7.  
  8. #ifndef BYTE
  9. #define BYTE unsigned char
  10. #endif
  11.  
  12. typedef struct
  13. {BYTE MOD_KSL,MOD_fMult,MOD_attack,MOD_sustain,MOD_ss;
  14.  BYTE MOD_decay,MOD_release,MOD_outputLevel;
  15.  BYTE MOD_amplitudeVibrato,MOD_frequencyVibrato,MOD_envelopeScaling;
  16.  
  17.  BYTE CAR_KSL,CAR_fMult,CAR_FB,CAR_attack,CAR_sustain,CAR_ss;
  18.  BYTE CAR_decay,CAR_release,CAR_outputLevel;
  19.  BYTE CAR_amplitudeVibrato,CAR_frequencyVibrato,CAR_envelopeScaling;
  20.  
  21.  BYTE FM,MOD_waveForm,CAR_waveForm,feedBack,PADDING;
  22. }  FMInstrument;
  23.  
  24.  
  25. /* function prototyping */
  26. void WriteFM(int reg, int value);
  27. int  ReadFM(void);
  28. int  AdlibExists(void);
  29.  
  30. void FMReset(int percusiveMode);
  31. /* Resets the card, quiets all voices, sets the percussive mode state */
  32.  
  33. void FMKeyOff(int voice);
  34. /* Percussion is handled correctly */
  35.  
  36. void FMKeyOn(int voice, int freq);
  37. /* Percussion is handled correctly */
  38.  
  39. void FMVoiceVolume(int voice, int vol);
  40. /* Never tested this, probably doesn't work. */
  41.  
  42. void FMSetVoice(int voiceNum, FMInstrument *ins);
  43. /* Remember: percussion instruments must be assigned only to the
  44. correct voice number. */
  45.  
  46. void FMSetPercusiveMode(int state);
  47.  
  48.  
  49.